-- GENERATED SPELL FOR [Martik Tor'seldori] --


function spell0_16577(pUnit, Event) --@Cone of Cold,Self--
pUnit:FullCastSpellOnTarget(15244,pUnit)
pUnit:RegisterEvent('Sorts_16577', 8333, 1)
end

function spell1_16577(pUnit, Event) --@Counterspell,n/a--
pUnit:FullCastSpellOnTarget(15122,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16577', 15270, 1)
end

function spell2_16577(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(15242,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_16577', 3000, 1)
end

function spell3_16577(pUnit, Event) --@Frost Armor,Self--
pUnit:FullCastSpellOnTarget(18100,pUnit)
pUnit:RegisterEvent('Sorts_16577', 0, 1)
end

function Sorts_16577(pUnit, Event)
local choix_sorts_16577 = math.random(0, 3)
if choix_sorts_16577 == 0 then
pUnit:RegisterEvent('spell0_16577', 1, 1)
end
if choix_sorts_16577 == 1 then
pUnit:RegisterEvent('spell1_16577', 1, 1)
end
if choix_sorts_16577 == 2 then
pUnit:RegisterEvent('spell2_16577', 1, 1)
end
if choix_sorts_16577 == 3 then
pUnit:RegisterEvent('spell3_16577', 1, 1)
end
end

function mob16577_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16577', math.random(1500, 3000), 1)
end

function mob16577_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16577_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16577_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16577, 1, 'mob16577_Action')
RegisterUnitEvent(16577, 2, 'mob16577_Leave')
RegisterUnitEvent(16577, 3, 'mob16577_Kill')
RegisterUnitEvent(16577, 4, 'mob16577_Die')
